Integrand size = 35, antiderivative size = 205 \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {2 \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {4 a b (7 A+5 C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {4 a b (7 A+5 C) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d} \]
[Out]
Time = 0.48 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3129, 3112, 3102, 2827, 2719, 2715, 2720} \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {2 \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{45 d}+\frac {4 a b (7 A+5 C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {4 a b (7 A+5 C) \sin (c+d x) \sqrt {\cos (c+d x)}}{21 d}+\frac {8 a b C \sin (c+d x) \cos ^{\frac {5}{2}}(c+d x)}{63 d}+\frac {2 C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2}{9 d} \]
[In]
[Out]
Rule 2715
Rule 2719
Rule 2720
Rule 2827
Rule 3102
Rule 3112
Rule 3129
Rubi steps \begin{align*} \text {integral}& = \frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {2}{9} \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x)) \left (\frac {3}{2} a (3 A+C)+\frac {1}{2} b (9 A+7 C) \cos (c+d x)+2 a C \cos ^2(c+d x)\right ) \, dx \\ & = \frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {4}{63} \int \sqrt {\cos (c+d x)} \left (\frac {21}{4} a^2 (3 A+C)+\frac {9}{2} a b (7 A+5 C) \cos (c+d x)+\frac {7}{4} \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^2(c+d x)\right ) \, dx \\ & = \frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {8}{315} \int \sqrt {\cos (c+d x)} \left (\frac {21}{8} \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right )+\frac {45}{4} a b (7 A+5 C) \cos (c+d x)\right ) \, dx \\ & = \frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {1}{7} (2 a b (7 A+5 C)) \int \cos ^{\frac {3}{2}}(c+d x) \, dx+\frac {1}{15} \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) \int \sqrt {\cos (c+d x)} \, dx \\ & = \frac {2 \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {4 a b (7 A+5 C) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {1}{21} (2 a b (7 A+5 C)) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {4 a b (7 A+5 C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {4 a b (7 A+5 C) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 a^2 C+b^2 (9 A+7 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {8 a b C \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))^2 \sin (c+d x)}{9 d} \\ \end{align*}
Time = 2.55 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.72 \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {84 \left (3 a^2 (5 A+3 C)+b^2 (9 A+7 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+120 a b (7 A+5 C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+\sqrt {\cos (c+d x)} \left (7 \left (36 A b^2+36 a^2 C+43 b^2 C\right ) \cos (c+d x)+5 b (168 a A+156 a C+36 a C \cos (2 (c+d x))+7 b C \cos (3 (c+d x)))\right ) \sin (c+d x)}{630 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(586\) vs. \(2(237)=474\).
Time = 24.36 (sec) , antiderivative size = 587, normalized size of antiderivative = 2.86
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-1120 C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+\left (1440 C a b +2240 b^{2} C \right ) \left (\sin ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-504 A \,b^{2}-504 a^{2} C -2160 C a b -2072 b^{2} C \right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (840 A a b +504 A \,b^{2}+504 a^{2} C +1680 C a b +952 b^{2} C \right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-420 A a b -126 A \,b^{2}-126 a^{2} C -480 C a b -168 b^{2} C \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+210 A a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-315 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-189 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}+150 C a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-189 C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-147 C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}\right )}{315 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(587\) |
parts | \(\text {Expression too large to display}\) | \(947\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.12 (sec) , antiderivative size = 253, normalized size of antiderivative = 1.23 \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {-30 i \, \sqrt {2} {\left (7 \, A + 5 \, C\right )} a b {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 30 i \, \sqrt {2} {\left (7 \, A + 5 \, C\right )} a b {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 2 \, {\left (35 \, C b^{2} \cos \left (d x + c\right )^{3} + 90 \, C a b \cos \left (d x + c\right )^{2} + 30 \, {\left (7 \, A + 5 \, C\right )} a b + 7 \, {\left (9 \, C a^{2} + {\left (9 \, A + 7 \, C\right )} b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 21 \, \sqrt {2} {\left (-3 i \, {\left (5 \, A + 3 \, C\right )} a^{2} - i \, {\left (9 \, A + 7 \, C\right )} b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 21 \, \sqrt {2} {\left (3 i \, {\left (5 \, A + 3 \, C\right )} a^{2} + i \, {\left (9 \, A + 7 \, C\right )} b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{315 \, d} \]
[In]
[Out]
Timed out. \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\cos \left (d x + c\right )} \,d x } \]
[In]
[Out]
\[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sqrt {\cos \left (d x + c\right )} \,d x } \]
[In]
[Out]
Time = 2.61 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.17 \[ \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {2\,A\,a^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}-\frac {2\,A\,b^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,C\,a^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,C\,b^2\,{\cos \left (c+d\,x\right )}^{11/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {11}{4};\ \frac {15}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{11\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,C\,a\,b\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \]
[In]
[Out]